import { ElMessage, ElMessageBox } from 'element-plus'

export const WarningBox = (onDelete:()=>void) => {
  ElMessageBox.confirm(
    '将会删除这条数据. 是否继续?',
    'Warning',
    {
      confirmButtonText: '确认',
      cancelButtonText: '取消',
      type: 'warning',
      center: true,
    }
  )
    .then(() => {
        onDelete(); 
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消删除',
      })
    })
}